<template>
    <view style="width: 100%; height:500rpx;padding: 0 20rpx;">
        <lechart ref="chart"></lechart>
    </view>
</template>
<script>
const echarts = require('../static/echarts.min.js')
//---or----------------------------------
import lechart from '../uni_modules/lime-echart/components/l-echart/l-echart.vue'
export default {
    components: {
        lechart
    },
    data() {
        return {
            option: {
                tooltip: {
                    trigger: 'item'
                },
                legend: {
                    top: '5%',
                    left: 'center'
                },
                series: [
                    {
                    name: 'Access From',
                    type: 'pie',
                    radius: ['40%', '70%'],
                    avoidLabelOverlap: false,
                    itemStyle: {
                        borderRadius: 10,
                        borderColor: '#fff',
                        borderWidth: 2
                    },
                    label: {
                        show: false,
                        position: 'center'
                    },
                    emphasis: {
                        label: {
                        show: true,
                        fontSize: 40,
                        fontWeight: 'bold'
                        }
                    },
                    labelLine: {
                        show: false
                    },
                    data: [
                        { value: 1048, name: '待审批' },
                        { value: 735, name: '已同意' },
                        { value: 580, name: '已拒绝' },
                        { value: 484, name: '已驳回' },
                        { value: 300, name: '已取消' }
                    ]
                    }
                ]
            }
        }
    },
    mounted() {
        console.log('进来了');

        this.$refs.chart.init(echarts, chart => {
			chart.setOption(this.option);
            console.log(11);
            
		});
    }
}
</script>
<style lang="scss" scoped></style>